﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace NJL.WebManage.SystemNews
{
    public partial class EditNewsPager :BasePage
    {
        NJL.BLL.NJL_SYS_NEWS_CHAPTER bll = new BLL.NJL_SYS_NEWS_CHAPTER();
        NJL.Model.NJL_SYS_NEWS_CHAPTER model;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                model = bll.GetModel(Request.QueryString["id"]);
                txtContent.Text = model.CHAPTER_CONTENT;
                txtPageIndex.Text = model.CHAPTER_CODE.ToString();
            }
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            model = bll.GetModel(Request.QueryString["id"]);
            model.CHAPTER_CONTENT = txtContent.Text.Trim();
            model.UPDATE_DATE_TIME = DateTime.Now;
            model.UPDATE_USER_ID = USER_ID;
            model.UPDATE_USER_NAME = USER_NAME;
            model.CHAPTER_CODE = int.Parse(txtPageIndex.Text.Trim());
            bll.Update(model);
            Royalsoft.Common.MessageBox.ShowAndRedirect(this, "更新成功", Request.Url.ToString());
        }
    }
}